<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/jquery-1.12.4.js"></script>
    <script>
        $(function() {
            var $button = $("#mybutton");
            var $text = $("#mytext");
            var $div = $("div");

            // 按钮点击事件
            $button.click(function() {
                var str = $text.val();
                alert("按钮点击:" + str);
            });

            //获取焦点事件
            $text.focus(function() {
                $text.css({background:"red"});
            });

            // 设置失去焦点事件
            $text.blur(function() {
                $text.css({background:"white"});
            });

            // 设置鼠标进入事件
            $div.mouseover(function() {
                $div.css({width:"200px", height:"200px", background:"red"});
            });

            // 设置鼠标离开事件
            $div.mouseout(function() {
                $div.css({width:"100px", height:"100px", background:"green"});
            });
            
        });
    </script>

    <style>
        div {
            width: 100px;
            height: 100px;
            background: green;
        }
    </style>
</head>
<body>
    <input type="button" value="按钮" id="mybutton">
    <input type="text" id="mytext">
    <div>
        <p>我是一个段落标签</p>
    </div>
</body>
</html>